package com.qfedu.api.point.fallback;

import com.qfedu.api.point.feign.PointFeignService;
import com.qfedu.common.core.common.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @Classname PointFallbackFactory
 * @Description TODO
 * @Date 2025-05-28 16:25
 * @Created by 老任与码
 */
@Slf4j
@Component
public class PointFallbackFactory implements FallbackFactory<PointFeignService> {
    @Override
    public PointFeignService create(Throwable cause) {
        return new PointFeignService() {
            @Override
            public R remoteAddPoint(Integer pointType) {
                log.error(cause.getMessage());
                return R.fail("调用送积分服务异常");
            }
        };
    }
}
